#ifndef _HEADER_VegetableGarden_H
#include "VegetableGarden.h"
#endif

/**
 * 菜地测试
 * */
VegetableGarden vegetableGarden;
VegetableGardenConfig vegetableGardenConfig;
char    logStr[400]="";

void setup()
{
    Serial.begin(9600);
    vegetableGardenConfig.gardenType = Cabbage;
    vegetableGardenConfig.humiditySensorPort = A1;
    vegetableGardenConfig.waterSwitchPort = 7;
    vegetableGarden.init(&vegetableGardenConfig);
    vegetableGarden.toString(logStr);
    Serial.println(logStr);
}

void loop() 
{
    bool isCanWatering = vegetableGarden.isCanWatering();
    if(isCanWatering)
    {
        vegetableGarden.openWaterSwitch();
    }
    else
    {
        vegetableGarden.closeWaterSwitch();
    }
    vegetableGarden.toString(logStr);
    Serial.println(logStr);
    delay(3000);
}
